<template>
  <div class="search">
    <div class="search-head">
      <h1>智慧城市</h1>
    </div>
    <div class="search-box">
      <van-search
        v-model="value"
        placeholder="请输入搜索关键词"
        @search="onSearch"
      />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
    };
  },
  methods: {
    onSearch(val) {
      console.log(val);
      this.$router.push(`/news?val=${val}`);
    },
  },
};
</script>

<style lang="scss" scoped>
.search {
  .search-head {
    background: #52a1fe;
    text-align: center;
    color: #fff;
    font-weight: 800;
  }
  .search-box {
    .van-search {
      .van-search__content {
        border-radius: 38px;
      }
    }
  }
}
</style>
